package exceptionExample;

public class ThrowTest {
    static void test()
    {
        System.out.println("显式抛出异常");
        throw new ArithmeticException();
    }
    public static void main(String[] args)
    {
        try
        {
            test();
        }
        catch(ArithmeticException e)
        {
            System.out.println("收到异常");
            System.out.println(e.getMessage());
        }
    }
}
